<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9"/>
<title>MSC for Windows&amp;Linux API: msp_cmn.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">MSC for Windows&amp;Linux API
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.9 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">msp_cmn.h 文件参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>Mobile Speech Platform Common Interface Header File.  
<a href="#details">更多...</a></p>

<p><a href="msp__cmn_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a137acfe684fe46cbe5baf19f7d4a7fcc"><td class="memItemLeft" align="right" valign="top">int MSPAPI&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="msp__cmn_8h.html#a137acfe684fe46cbe5baf19f7d4a7fcc">MSPLogin</a> (const char *usr, const char *pwd, const char *params)</td></tr>
<tr class="memdesc:a137acfe684fe46cbe5baf19f7d4a7fcc"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化msc，用户登录。  <a href="#a137acfe684fe46cbe5baf19f7d4a7fcc">更多...</a><br /></td></tr>
<tr class="separator:a137acfe684fe46cbe5baf19f7d4a7fcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e0f72cd113b4578afdf3d16ab34463e"><td class="memItemLeft" align="right" valign="top">int MSPAPI&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="msp__cmn_8h.html#a1e0f72cd113b4578afdf3d16ab34463e">MSPLogout</a> ()</td></tr>
<tr class="memdesc:a1e0f72cd113b4578afdf3d16ab34463e"><td class="mdescLeft">&#160;</td><td class="mdescRight">退出登录。  <a href="#a1e0f72cd113b4578afdf3d16ab34463e">更多...</a><br /></td></tr>
<tr class="separator:a1e0f72cd113b4578afdf3d16ab34463e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adda40e907aa1a1fb781efe986556e751"><td class="memItemLeft" align="right" valign="top">int MSPAPI&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="msp__cmn_8h.html#adda40e907aa1a1fb781efe986556e751">MSPSetParam</a> (const char *paramName, const char *paramValue)</td></tr>
<tr class="memdesc:adda40e907aa1a1fb781efe986556e751"><td class="mdescLeft">&#160;</td><td class="mdescRight">参数设置接口、离线引擎初始化接口。  <a href="#adda40e907aa1a1fb781efe986556e751">更多...</a><br /></td></tr>
<tr class="separator:adda40e907aa1a1fb781efe986556e751"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d3fa0aad5e761cb2a2afe30ae2a9714"><td class="memItemLeft" align="right" valign="top">int MSPAPI&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="msp__cmn_8h.html#a4d3fa0aad5e761cb2a2afe30ae2a9714">MSPGetParam</a> (const char *paramName, char *paramValue, unsigned int *valueLen)</td></tr>
<tr class="memdesc:a4d3fa0aad5e761cb2a2afe30ae2a9714"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取MSC的设置信息  <a href="#a4d3fa0aad5e761cb2a2afe30ae2a9714">更多...</a><br /></td></tr>
<tr class="separator:a4d3fa0aad5e761cb2a2afe30ae2a9714"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>Mobile Speech Platform Common Interface Header File. </p>
<p>This file contains the quick common programming interface (API) declarations of MSP. Developer can include this file in your project to build applications. For more information, please read the developer guide.</p>
<p>Use of this software is subject to certain restrictions and limitations set forth in a license agreement entered into between iFLYTEK, Co,LTD. and the licensee of this software. Please refer to the license agreement for license use rights and restrictions.</p>
<p>Copyright (C) 1999 - 2015 by iFLYTEK, Co,LTD. All rights reserved.</p>
<dl class="section author"><dt>作者</dt><dd>MSC </dd></dl>
<dl class="section version"><dt>版本</dt><dd>5.0 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2015/03/19</dd></dl>
<dl class="section see"><dt>参见</dt><dd></dd></dl>
<p><b>History:</b><br />
 </p><table class="doxtable">
<tr>
<th>Version </th><th>Date </th><th>Author </th><th>Notes </th></tr>
<tr>
<td>5.0 </td><td>2015/03/19 </td><td>MSC </td><td>Create this file </td></tr>
</table>
</div><h2 class="groupheader">函数说明</h2>
<a class="anchor" id="a4d3fa0aad5e761cb2a2afe30ae2a9714"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MSPAPI MSPGetParam </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>paramName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>paramValue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&#160;</td>
          <td class="paramname"><em>valueLen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取MSC的设置信息 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">paramName[in]</td><td>参数名，一次调用只支持查询一个参数。参数如下： <table class="doxtable">
<tr>
<th>参数</th><th>描述 </th></tr>
<tr>
<td>upflow</td><td>上行数据量 </td></tr>
<tr>
<td>downflow</td><td>下行数据量 </td></tr>
</table>
</td></tr>
    <tr><td class="paramname">paramValue[in/out]</td><td>输入:buffer首地址<br />
输出:向该buffer写入获取到的信息 </td></tr>
    <tr><td class="paramname">valueLen[in/out]</td><td>输入:buffer的大小<br />
输出:信息实际长度(不含'\0') </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>函数调用成功返回MSP_SUCCESS，否则返回错误代码，<a href="http://open.voicecloud.cn/index.php/default/doccenter/doccenterInner?itemTitle=ZmFx&amp;anchor=Y29udGl0bGU2Ng==" target="_blank">详见错误码列表</a>。</dd></dl>
<dl class="section remark"><dt>备注</dt><dd>以查询上行流量为例，获取到的是当前累计的上行流量。下行流量查询与此相似。 </dd></dl>
<dl class="section see"><dt>参见</dt><dd><pre class="fragment">const char* para_name = "upflow";
char para_value[32] = {'\0'};
unsigned int value_len = 32;
int ret = MSPGetParam (para_name, para_value, &amp;value_len);
if(MSP_SUCCESS != ret)
{
    printf("MSPGetParam failed, error code is: %d", ret);
}
.</pre> </dd></dl>

</div>
</div>
<a class="anchor" id="a137acfe684fe46cbe5baf19f7d4a7fcc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MSPAPI MSPLogin </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>usr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>pwd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化msc，用户登录。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">usr[in]</td><td>此参数保留，传入NULL即可。 </td></tr>
    <tr><td class="paramname">pwd[in]</td><td>此参数保留，传入NULL即可。 </td></tr>
    <tr><td class="paramname">params[in]</td><td>参见下表: <table class="doxtable">
<tr>
<th>参数 </th><th>名称 </th><th>说明  </th></tr>
<tr>
<td>appid </td><td>应用ID。 </td><td>应用ID。SDK申请成功后获取到的appid。申请SDK请前往http://open.voicecloud.cn，此参数必须传入  </td></tr>
<tr>
<td>engine_start </td><td>离线引擎启动 </td><td>启动离线引擎，支持参数，ivw：唤醒，asr：识别、听写，tts：合成  </td></tr>
<tr>
<td>[xxx]_res_path </td><td>离线引擎资源路径 </td><td>设置ivw、asr、tts 引擎离线资源路径，详细格式如下：fo|[path]|[offset]|[length]|xx|xx。<br />
示例如下,单个资源路径：<br />
ivw_res_path=fo|res/ivw/wakeupresource.jet，多个资源路径：asr_res_path=fo|res/asr/common.jet;fo|res/asr/sms.jet  </td></tr>
</table>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回MSP_SUCCESS,否则返回错误代码，<a href="http://open.voicecloud.cn/index.php/default/doccenter/doccenterInner?itemTitle=ZmFx&amp;anchor=Y29udGl0bGU2Ng==" target="_blank">详见错误码列表</a>。 </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>使用其他接口前必须先调用MSPLogin，可以在应用程序启动时调用。</dd></dl>
<dl class="section see"><dt>参见</dt><dd><pre class="fragment">const char* usr = NULL;
const char* pwd = NULL;
const char* params="appid = ********, engine_start = ivw,ivw_res_path=fo|res/ivw/wakeupresource.jet";
int ret = MSPLogin( usr, pwd, params );
if( MSP_SUCCESS != ret )
{
    printf( "MSPLogin failed, error code is: %d", ret );
}
.</pre> </dd></dl>

</div>
</div>
<a class="anchor" id="a1e0f72cd113b4578afdf3d16ab34463e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MSPAPI MSPLogout </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>退出登录。 </p>
<dl class="section return"><dt>返回</dt><dd>如果函数调用成功返回MSP_SUCCESS，否则返回错误代码，<a href="http://open.voicecloud.cn/index.php/default/doccenter/doccenterInner?itemTitle=ZmFx&amp;anchor=Y29udGl0bGU2Ng==" target="_blank">详见错误码列表</a>。</dd></dl>
<dl class="section remark"><dt>备注</dt><dd>本接口和MSPLogin配合使用。确保其他接口调用结束之后调用MSPLogout，否则结果不可预期。</dd></dl>
<dl class="section see"><dt>参见</dt><dd><pre class="fragment">int ret = MSPLogout( );
if(MSP_SUCCESS != ret)
{
    printf("MSPLogout failed, error code is: %d", ret);
}
.</pre> </dd></dl>

</div>
</div>
<a class="anchor" id="adda40e907aa1a1fb781efe986556e751"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MSPAPI MSPSetParam </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>paramName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>paramValue</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>参数设置接口、离线引擎初始化接口。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">paramName[in]</td><td>参数名，可设置参数如下： <table class="doxtable">
<tr>
<th>参数</th><th>名称 </th><th>说明  </th></tr>
<tr>
<td>engine_start</td><td>engine_start 启动离线引擎 </td><td>启动引擎： <br />
设置paramName为engine_start<br />
paramValue为engine_start=asr、tts、ivw 等离线业务<br />
 之后后加资源所在路径<br />
例如engine_start=asr;tts,asr_res_path=fo|file_path|[offset]|[length]  </td></tr>
<tr>
<td>engine_destroy</td><td>销毁离线引擎 </td><td>销毁引擎：<br />
设置paramName 为engine_destroy <br />
paramValue 为asr 、tts 、ivw （ 如engine_destroy=tts）等离线业务  </td></tr>
</table>
</td></tr>
    <tr><td class="paramname">paramValue[in]</td><td>参数值。 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>函数调用成功则其值为MSP_SUCCESS，否则返回错误代码，<a href="http://open.voicecloud.cn/index.php/default/doccenter/doccenterInner?itemTitle=ZmFx&amp;anchor=Y29udGl0bGU2Ng==" target="_blank">详见错误码列表</a>。 </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>无 </dd></dl>
<dl class="section see"><dt>参见</dt><dd><pre class="fragment">const char* paramsName= "engine_start";
const char* paramsValue="engine_start=tts,voice_name=xiaoyan,tts_res_path=fo|res\\tts\\common.jet;fo|res\\tts\\xiaoyan.jet";
errorcode = MSPSetParam (paramsName, paramsValue);
if( MSP_SUCCESS != errorcode )
{
    printf( "MSPSetParam failed, error code is: %d", ret );
}
.</pre> </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2017年 二月 24日 星期五 16:52:46 , 为 MSC for Windows&amp;Linux API使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9
</small></address>
</body>
</html>
